package bma.common.langutil.ai.stack;

import bma.common.langutil.ai.callback.AICallback;

/**
 * 
 * @author guanzhong
 * @since 1.0 (imported from BMA.ESP Project)
 * 
 * @param <RESP_TYPE>
 */
public class AICallbackToStack<RESP_TYPE> implements AICallback<RESP_TYPE> {

	protected AIStack<RESP_TYPE> stack;

	public AICallbackToStack(AIStack<RESP_TYPE> stack) {
		super();
		this.stack = stack;
	}

	@Override
	public void onSuccess(RESP_TYPE result) {
		stack.success(result);
	}

	@Override
	public void onFailure(Throwable t) {
		stack.failure(t);
	}

}
